package ControlLayer;
import ModelLayer.OrderDetail;
import DBLayer.DBOrderDetail;
import java.util.ArrayList;

public class CtrOrderDetail {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrOrderDetail instance = null;
    DBOrderDetail dbOrderDetail = new DBOrderDetail();

    public CtrOrderDetail() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrOrderDetail getInstance() {
        if (instance == null) {
            instance = new CtrOrderDetail();
        }
        return instance;
    }

    public ArrayList<OrderDetail> getOrderDetailList() {
        return dbOrderDetail.getOrderDetailList();
    }

    public OrderDetail getOrderDetailByID(int id) {
        return dbOrderDetail.getOrderDetailByID(id);
    }

    public int addOrderDetail(OrderDetail orderDetail) {
        return dbOrderDetail.addOrderDetail(orderDetail);
    }

    public int updateOrderDetail(OrderDetail orderDetail, int id) {
        return dbOrderDetail.updateOrderDetail(orderDetail, id);
    }

    public void deleteOrderDetail(int id) {
        dbOrderDetail.deleteOrderDetail(id);
    }
    // </editor-fold>
}
